<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //new regExp  在new 的时候就可以使用变量来替代了
        let web="dwdwa4";
        let reg= new RegExp("4","g");//4表示查找的对象 g 表示全局gobol
        console.log(reg.test(web));//true

        
    </script>
</body>
</html>